package com.mobileshop.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
/**
 * create table T_PRODUCT
 *(
 *code     VARCHAR2(10) not null,
 *name     VARCHAR2(50),
 *brand    VARCHAR2(20),
 *spec     VARCHAR2(20),
 *price    FLOAT(8),
 *img      VARCHAR2(256),
 *category VARCHAR2(6)
 *)
 * @author yehuan
 *
 */


public class YProduct  extends Model<YProduct>{
	public final static YProduct dao=new YProduct();
	//这个属性与数据库无关，用于在订单待创建界面展示商品的数量。
	private int amount=0;
	
	public List<YProduct> findByCategory(String categorycode){
		return find("select * from t_product where category='"+categorycode+"' ");
	}
	public int getAmount() {
		return amount;
	}
	public void setAmount(int amount) {
		this.amount = amount;
	}
}
